var myName = $('#username');
var myPassword = $('#password');
$("#login").click(function (event) {

    var getUsername = myName.val();
    var getPassword = myPassword.val();

    if (!myValidateUsername() || !myValidatePassword()){
        alert("正确填写信息哦");
    }
});

function GetQueryString(name)
{
    var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
    var r = window.location.search.substr(1).match(reg);
    if(r!=null)return  unescape(r[2]); return null;
}
var qqMessage = GetQueryString("code");

if (qqMessage != null){

    document.getElementById("username").value=qqMessage;
    document.getElementById("password").value=qqMessage;
    document.getElementById("login").click();
}


function myValidateUsername() {
    var input = document.loginForm.username.value;
    if(input == "" || input == null){
        document.getElementById("someMeg").innerHTML="是用户名不是昵称";
        return false;
    }else{
        document.getElementById("someMeg").innerHTML=" ";
        return true;
    }
}
function myValidatePassword() {
    var input = document.loginForm.password.value;
    if(input == "" || input == null){
        document.getElementById("someMeg").innerHTML="你猜我知不知道？";
        return false;
    }else{
        document.getElementById("someMeg").innerHTML=" ";
        return true;
    }
}


